package com.medaxis.hpams.sso.utils;

import com.medaxis.hpams.dto.global.BaseResponse;
import com.medaxis.hpams.dto.global.ErrorException;
import com.medaxis.hpams.dto.global.SuccessResponse;
import org.springframework.stereotype.Component;

/**
 * 返回类型封装
 */
@Component
public class ResponseUtils {
    public BaseResponse toResponse(int rows){
        if(rows>0){
            return new SuccessResponse(rows);
        }
        throw new ErrorException();
    }
}
